import { ReactNode,lazy } from "react";

const IndexPage = lazy(()=> import("../pages/index/index"))
const Apply = lazy(()=> import("../pages/apply"))
const Storage = lazy(()=> import("../pages/storage"))
const User = lazy(()=> import("../pages/user"))
const UserDetail = lazy(()=> import("../pages/user/userDetail"))

export interface IRouter {
  id: number
  path: string
  title: string
  component?: ReactNode
  children?: IRouter[]
}
const AppRouter: IRouter[] = [
  {
    id: 1,
    path: "index",
    title: "index page",
    component: <IndexPage />
  },
  {
    id: 2,
    path: "apply",
    title: "apply page",
    component: <Apply />
  }, {
    id: 3,
    path: "storage",
    title: "storage page",
    component: <Storage />
  }, {
    id: 4,
    path: "user",
    title: "user page",
    component: <User />,
    children: [
      {
        id: 5,
        path: "detail",
        title: "userDetail",
        component: <UserDetail/>
      }
    ]
  },
];

export default AppRouter;

